Xbasic

FILENAME_DECODE Function

Syntax

Fully_Qualified_Filename as C = filename_decode(C filename [,C reference_path ])

Arguments

filename

An alias and filename (typically without path information).

reference_path

Optional. Default = path of current database. A path to use as a starting point in composing the filename.

Description

FILENAME_DECODE() returns a character string after converting an aliased filename to a fully qualified filename. The value of the FILENAME_DECODE() and FILENAME_ENCODE()functions is that they make it easier to develop an application that is less location dependent. In the following example, "[documents]" is defined as "c:\documents\".

Example

dim cs as C
cs = filename_decode("[documents]upgrade.txt")
cs -> "c:\documents\upgrade.txt"

This script decodes a Alpha Anywhere alias. Assume you have a setting that says: [System] = C:\WINNT\System32\.

sys_shell(filename_decode("[System]Calc.exe"),1)

See Also